<template>
  <div class="filter-container">
    <section class="menu-container">
      <div
        class="select-item"
        v-for="item in menuList"
        :key="item.id"
        @touchstart="handleSelect(item.id)"
      >
        <span class="item-titile">{{ item.label}}</span>
        <img
          :class="['item-icon', 'icon-arrow',data.selectedMenu === item.id?'select-active':'']"
          :src="require('../../../../assets/png/icon-select-arrow.png')"
        />
      </div>
    </section>
    <!-- 筛选内容 -->
    <div class="filter-content-1">
      <p class="content-title">日期范围</p>
      <div class="fixed-time">
        <span class="fixed-time-item" @click="setTime(1)">一天</span>
        <span class="fixed-time-item" @click="setTime(2)">两天</span>
        <span class="fixed-time-item" @click="setTime(3)">三天</span>
        <span class="fixed-time-item" @click="setTime(4)">四天</span>
      </div>
      <div class="time-range"></div>
      <p class="content-title">告警类型</p>
    </div>
  </div>
</template>

<script setup>
import { reactive } from "vue";

const menuList = [
  { label: "全部设备", id: 1 },
  { label: "全部结果", id: 2 },
  { label: "筛选", id: 3 }
];
const data = reactive({
  selectedMenu: 0,
  dateRange: []
});
const handleSelect = e => {
  if (data.selectedMenu === e) {
    data.selectedMenu = 0;
  } else {
    data.selectedMenu = e;
  }
};
</script>

<style lang="less">
.filter-container {
  background: rgba(25, 39, 80, 1);
  .menu-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    .select-item {
      flex: 1;
      height: 22px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 16px;
      color: rgba(255, 255, 255, 0.85);
      line-height: 22px;
      text-align: center;
      font-style: normal;
      .icon-arrow {
        width: 12px;
        height: 12px;
        transition: all 0.3s linear;
      }
      .select-active {
        transform: rotate(180deg);
      }
    }
  }
  .filter-content-1 {
    padding: 16px;
    // height: 333px;
    background: #192750;
    .content-title {
      height: 20px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 14px;
      color: rgba(255, 255, 255, 0.45);
      line-height: 20px;
      text-align: left;
      font-style: normal;
    }
    .fixed-time{
        
    }
  }
}
</style>